<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.css" rel="stylesheet" />
		<style type="text/css">
			body{
				background-image: url("img/yujian.png");
				background-size: 100% 100vh;
				background-repeat: no-repeat;
			}
		</style>
	</head>

	<body>
		
		<script src="js/mui.js"></script>
		<script src="js/main.js"></script>
		<script type="text/javascript">
			mui.init()
			mui.plusReady(function () {
			    plus.nativeUI.showWaiting("正在加载数据");
				const userInfo = plus.storage.getItem("userInfo");
				if(userInfo){ 
					var entity = JSON.parse(userInfo);
					_SERVER.user.getUserInfo(entity.token).then(res=>{
						console.log(JSON.stringify(res));
						if(res.code === "200" && res.data){
							toPage("index.html");
						}else{
							toPage("pages/login.html");
						}
					})
					
				}else{
					toPage("pages/login.html");
				}
			})
			
			function toPage(url){
				window.setTimeout(()=>{
					plus.nativeUI.closeWaiting();
					plus.nativeUI.showWaiting("即将跳转页面");
					plus.webview.create(url,url,{},{waitCloseWebView:plus.webview.currentWebview().id});
					// mui.openWindow({
					// 	url:url,
					// 	id:url,
					// 	waiting:{
					// 		 autoShow: true, //自动显示等待框，默认为true  
					// 		 title: '即将跳转页面', //等待对话框上显示的提示内容  
					// 	},show:{
					// 		autoShow:false,
					// 		aniShow:"none"
					// 	}
					// })
				},1500);
				
			}
		</script>
	</body>

</html>
